<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue.js demo</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
    <h1>{{message}}</h1>
    <input type="text" :value="f1">
    <input type="text" v-model="f1">

    <button v-on:click="alert('hallo...vue......')">点击事件</button>
    <button @click="reversed()">点击反转</button>
    <span>{{message}}</span>

    <br/><span>{{m2}}</span>
    <br/><span>{{m2}}</span>
    <br/><span>{{m2}}</span>
    <br/><span>{{m2}}</span>
    <br/><span>{{m2}}</span>
    <br/><span>{{m2}}</span>
</div>
</body>

<script>
    new Vue({
        el: '#app',
        data() {
            return {
                message: 'hello vue...',
                f1: "hello..."
            }
        },
        methods:{
            alert(message) {
               alert(message)
            },
            reversed(){
                console.log('reversed方法被调用...')
                this.message = this.message.split('').reverse().join('')
            }
        },
        computed:{
            m1() {
                return 'xyxiloveyou'
            },
            m2() {
                console.log('m2...')
                return this.message.split('').reverse().join('')
            }
        }
    })

</script>
</html>
